﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.ProductInfo
{
    public class ProductImg
    {
        public int ID { get; set; }
        public int ProductID { get; set; }
        public string Title { get; set; }
        public string ImgUrl { get; set; }
        public int? SortNum { get; set; }
        public string Description { get; set; }
        public DateTime CreateTime { get; set; }
        public string Creator { get; set; }

        public static ProductImg AsProductImg(PP_ProductImg ppimg)
        {
            ProductImg pimg = new ProductImg
            {
                ID = ppimg.ID,
                ProductID = ppimg.ProductID,
                Title = ppimg.Title,
                ImgUrl = ppimg.ImgUrl,
                SortNum = ppimg.SortNum,
                Description = ppimg.Description,
                CreateTime = ppimg.CreateTime,
                Creator = ppimg.Creator
            };
            return pimg;
        }
    }
}
